/**
 * 
 */
package de.guidoludwig.jtm.domain;

import javax.persistence.MappedSuperclass;

import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Store;

/**
 * @author guido
 *
 */
@MappedSuperclass
public abstract class CodedNamedPersistentObject extends NamedPersistentObject {
	
	public static final String PROPERTY_CODE = "code";
	
	@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
//	@Analyzer(definition="standardStringAnalyzer")
	private String code;
	
	protected CodedNamedPersistentObject() {
		super();
	}
	
	
	public String getCode() {
		return code;
	}
	public void setCode(String name) {
		String old = getCode();
		this.code = name;
		firePropertyChange(PROPERTY_CODE, old, getCode());
	}	

}
